package dao.community;

import domain.Community;
import domain.Page;

import java.sql.Connection;
import java.util.ArrayList;
import java.util.List;

public interface CommunityDao {

    /**
     * 添加社区信息
     * @param connection
     * @param community
     * @return int
     * @author 荣燊
     * @date 2020/7/15 10:42
     */
    public int addCommunity(Connection connection, Community community) throws Exception;

    /**
     * 根据community_id删除社区信息
     * @param connection
     * @param community_id
     * @retur int
     * @author 荣燊
     * @date 2020/7/12 21:55
     */
    public int delteCommunity(Connection connection, int community_id) throws Exception;

    /**
     * 根据community_id修改社区信息
     * @param connection
     * @param community_id
     * @param community_info
     * @return int
     */
    public int modifyCommunity(Connection connection, int community_id, String community_info) throws Exception;

    /**
     * 根据查询条件获取社区列表
     * @param connection
     * @param page
     * @return java.util.List<domain.Community>
     * @author 夏天辣鸡
     * @date 2020/7/12 22:09
     */
    public List<Community> getCommunityList(Connection connection, Page page) throws Exception;

    /**
     * 根据查询条件获取社区列表
     * @return java.util.List<domain.Community>
     * @author 夏天辣鸡
     * @date 2020/7/12 22:09
     */
    public List<Community> getCommunityList() throws Exception;

    /**
     * 根据查询条件获取社区列表
     * @param
     * @return java.util.List<domain.Community>
     * @author 荣燊
     * @date 2020/7/15 10:41
     */
    public List<Community> getCommunityList(Connection connection) throws Exception;

    /**
     * 根据社区id查询信息
     * @param connection
     * @param community_id
     * @return
     */
    public boolean getCommunityList(Connection connection, int community_id) throws Exception;

    /**
     * 根据id查询社区名
     * @param
     * @return java.util.List<domain.Community>
     * @author 夏添
     * @date 2020/7/15 12：25
     */
    public String getIdForName(String view_power) throws Exception;

    /**
     * 获取社区数据条数
     * @return int
     * @author 夏天
     * @date 2020/7/15 14:50
     */
    public int getCont();

    /**
     * 条件筛选社区
     * @param  view_power
     * @return ArrayList
     * @author 夏天
     * @date 2020/7/21 20:32
     */
    public ArrayList<Community> queryCommunity(String view_power) throws Exception;
}
